home *** CD-ROM | disk | FTP | other *** search
- /*----------------------------------------------------------------------------*\
- | Routines for dealing with Device independent bitmaps |
- \*----------------------------------------------------------------------------*/
-
- HANDLE OpenDIB(LPSTR szFile);
- BOOL WriteDIB(LPSTR szFile,HANDLE hdib);
- WORD PaletteSize(VOID FAR * pv);
- WORD DibNumColors(VOID FAR * pv);
- HPALETTE CreateDibPalette(HANDLE hdib);
- HPALETTE CreateBIPalette(LPBITMAPINFOHEADER lpbi);
- HPALETTE CreateColorPalette(void);
- HPALETTE CreateSystemPalette(void);
- HANDLE DibFromBitmap(HBITMAP hbm, DWORD biStyle, WORD biBits, HPALETTE hpal, WORD wUsage);
- HANDLE DibFromDib(HANDLE hdib, DWORD biStyle, WORD biBits, HPALETTE hpal, WORD wUsage);
- HANDLE BitmapFromDib(HANDLE hdib, HPALETTE hpal, WORD wUsage);
- BOOL SetDibUsage(HANDLE hdib, HPALETTE hpal,WORD wUsage);
- BOOL DibInfo(HANDLE hdib,LPBITMAPINFOHEADER lpbi);
- BOOL ReadDibBitmapInfo(int fh, LPBITMAPINFOHEADER lpbi);
- BOOL SetPalFlags(HPALETTE hpal, int iIndex, int cntEntries, WORD wFlags);
- BOOL PalEq(HPALETTE hpal1, HPALETTE hpal2);
- BOOL MapDib(HANDLE hdib, HPALETTE hpal);
- HANDLE ResizeDib(HANDLE hdib, int dx, int dy);
-
- BOOL DrawBitmap(HDC hdc, int x, int y, HBITMAP hbm, DWORD rop);
- VOID DrawDib(HDC hdc, int x, int y, HANDLE hdib, HPALETTE hpal, WORD wUsage);
- BOOL StretchBitmap(HDC hdc, int x, int y, int dx, int dy, HBITMAP hbm, int x0, int y0, int dx0, int dy0, DWORD rop);
-
- BOOL DibBlt(HDC hdc, int x0, int y0, int dx, int dy, HANDLE hdib, int x1, int y1, LONG rop, WORD wUsage);
- BOOL StretchDibBlt(HDC hdc, int x, int y, int dx, int dy, HANDLE hdib, int x0, int y0, int dx0, int dy0, LONG rop, WORD wUsage);
-
- LPVOID DibLock(HANDLE hdib,int x, int y);
- VOID DibUnlock(HANDLE hdib);
- LPVOID DibXY(LPBITMAPINFOHEADER lpbi,int x, int y);
- HANDLE CreateDib(int bits, int dx, int dy);
- HANDLE CopyDib (HANDLE hdib);
-
- #define BFT_ICON 0x4349 /* 'IC' */
- #define BFT_BITMAP 0x4d42 /* 'BM' */
- #define BFT_CURSOR 0x5450 /* 'PT' */
-
- #define ISDIB(bft) ((bft) == BFT_BITMAP)
- #define ALIGNULONG(i) ((i+3)&(~3)) /* ULONG aligned ! */
- #define WIDTHBYTES(i) ((unsigned)((i+31)&(~31))/8) /* ULONG aligned ! */
- #define DIBWIDTHBYTES(bi) (int)WIDTHBYTES((int)(bi).biWidth * (int)(bi).biBitCount)
-
- #define DIBSIZE(dibselector) (((LPBITMAPINFOHEADER)GLock(dibselector))->biSizeImage)
-
- #define DibPtr(hdib) ((LPBYTE)GLock(hdib) + \
- (int)((LPBITMAPINFOHEADER)GLock(hdib))->biSize + \
- (int)((LPBITMAPINFOHEADER)GLock(hdib))->biClrUsed * sizeof(RGBQUAD) )
-
- #define PALVERSION 0x300
- #define MAXPALETTE 256
-
- typedef struct {
- DWORD biSize;
- DWORD biWidth;
- DWORD biHeight;
- WORD biPlanes;
- WORD biBitCount;
- DWORD biCompression;
- DWORD biSizeImage;
- DWORD biXPelsPerMeter;
- DWORD biYPelsPerMeter;
- DWORD biClrUsed;
- DWORD biClrImportant;
-
- RGBQUAD argb[MAXPALETTE];
- } DIB8, FAR *LPDIB8;
-